{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
    {load href="__CSS__video-js.min.css"}
    {load href="__JS__video.min.js"}
<style>
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0px;
        margin-top: 0px
    }

    #title span {
        float: right;
        margin-left: 3.333px;
    }

    .search {
        margin-bottom: 0px !important;
    }

    .asdlkjasd {
        background: #1ab394;
        color: #fff
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content {:config('adminClass.main')}">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar loadClick">
                        <form  method="get" action="">
                            <div class="pull-left search">
                                <div class="columns columns-right btn-group pull-left" >
                                    <div class="columns columns-right btn-group pull-left" >
                                        <select class="form-control" name="search_typeid">
                                            <option value="" >任务名称</option>
                                            <option value="id" {eq name="search_typeid" value="id" }selected{/eq}>任务ID</option>
                                            {php}
                                            if(input('?param.search_typeid')){
                                            $typeidname=input('param.search_typeid');
                                            }else{
                                            $typeidname='';
                                            }
                                            {/php}
                                            {$typeidname}
                                        </select>
                                    </div>
                                </div>
                                {php}
                                if(input('?param.search_typeid') || input('?param.search_name')){
                                {/php}
                                <div class="pull-right search">
                                    <a class="btn btn-w-m btn-link" href="{:url('lists')}">返回管理</a>
                                </div>{php}
                                }
                                {/php}
                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px" class="btn btn-default btn-outline" id="search-btn" type="submit">搜索</button>
                                </div>
                                <div class="pull-right search">
                                    <input class="form-control input-outline" id="filter" type="text"
                                           {php}
                                           if(input('?param.search_name')){
                                    if(input('param.search_name')){
                                    echo "value='".input('search_name')."'";
                                    }
                                    }
                                    {/php}
                                    name="search_name" placeholder="输入内容搜索">
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                            <table data-toggle="table">
                                <thead>
                                <tr>
                                    <th class="bs-checkbox"><input type="checkbox" id="delidAll"></th>
                                    <th data-align="center">id</th>
                                    <th>名称</th>
                                    <th>图片</th>
                                    <th>奖励</th>
                                    <th>排序</th>
                                    <th data-align="center">创建时间</th>
                                    <th data-align="center">修改时间</th>
                                    <th data-align="center">管理</th>

                                </tr>
                                </thead>
                                <tbody id="form">
                                {volist name="data" id="v" key="k"}
                                <tr id="id{$v.id}" class="class">
                                    <td id="delid" ><input name="delAll[]" type="checkbox" value="{$v.id}"></td>
                                    <td id="id">{$v.id}</td>
                                    <td id="title">
                                            <?php echo $v['name']; ?>
                                    </td>
                                    <td>
                                        <a href="{:strpos($v.image, 'http')===false?'__ROOT__':''}{$v.image}" target="_blank">
                                            <img style="width:60px;height:60px;" src="{:strpos($v.image, 'http')===false?'__ROOT__':''}{$v.image}"/>
                                        </a>
                                    </td>
                                    <td>{$v.value}</td>
                                    <td>{$v.sort}</td>
                                    <td>
                                        <span {php}if(date('Y-m-d')==date('Y-m-d',$v['create_time']))echo 'style="color: #ed5565"';{/php}>{:date('Y-m-d H:i:s',$v['create_time'])}</span>
                                    </td>
                                    <td>
                                        <span {php}if(date('Y-m-d')==date('Y-m-d',$v['update_time']))echo 'style="color: #ed5565"';{/php}>{:date('Y-m-d H:i:s',$v['update_time'])}</span>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span>
                                            </div>
                                            <ul class="dropdown-menu">
                                                <li><a onclick="add('{:url('taskadd',['id'=>$v['id'],'url'=>-1])}')">修改</a>
                                                </li>
                                                <li class="divider"></li>
                                                <li><a onclick="del('{$v.id}')">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>

                                </tr>
                                {/volist}
                                </tbody>

                            </table>
                        </form>
                    </div>
                </div>
            </div>
            <div class="row row-lg">
                <div class="col-sm-6 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
    $(document).ready(function(){
    });
    function del(id){
        swal_del(id,"{:url('taskdel')}")
    }

</script>
 